package com.kfm.company.service.impl;

import com.kfm.company.mapper.UserMapper;
import com.kfm.company.model.User;
import com.kfm.company.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper mapper;

    @Override
    public User login(User user) {
        if (user.getName() == null || user.getName().isEmpty()
                || user.getPassword() == null || user.getPassword().isEmpty()) {
            return null;
        }
        return mapper.selectByUser(user);
    }
}
